package com.itheima.genericity;

public class GenericityDemo01 {
    public static void main(String[] args) {
        Box<String> box1 = new Box<>();
        box1.setE("String类型");
        System.out.println(box1.getE());//String类型

        Box<Integer> box2 = new Box<>();
        box2.setE(111);
        System.out.println(box2.getE());//111
    }
}

//泛型类
class Box<E>{
    private E e;


    public  E getE() {
        return e;
    }

    public  void setE(E e) {
        this.e = e;
    }
}
